package com.lichuang.dedao.ebook.controller;


import com.lichuang.dedao.ebook.entity.Category;
import com.lichuang.dedao.ebook.entity.EBook1;
import com.lichuang.dedao.ebook.service.ICategoryService;
import com.lichuang.dedao.ebook.service.impl.CategoryServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 分类 前端控制器
 * </p>
 *
 * @author miaomiao
 * @since 2019-07-15
 */
@RestController
@RequestMapping("/category")
public class CategoryController {
@Autowired
private ICategoryService categoryService;
    @RequestMapping("/getAllCategory")
    public List<Category> getAllCategory(){
        return categoryService.list();
    }
    @RequestMapping("/selectCategory")
    public List<Category> selectCategory() {
        List<Category> categorie = categoryService.selectCategory(-1);
        return categorie;
    }
    @RequestMapping("/selectCategoryByEBook")
    public List<Category> selectCategoryByListenBook(){
        return categoryService.selectCategoryIEBook();
    }
}
